package vista;
//import com.cloudgarden.layout.AnchorLayout;
//import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;

//import javax.swing.DefaultComboBoxModel;
//import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
//import javax.swing.JComponent;
import javax.swing.JLabel;
//import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
//import javax.swing.LayoutStyle;
//import javax.swing.ListModel;

import javax.swing.WindowConstants;
import javax.swing.border.BevelBorder;
//import javax.swing.table.DefaultTableModel;
//import javax.swing.table.TableModel;
//import javax.swing.SwingUtilities;

import javax.swing.table.AbstractTableModel;




/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VentanaConsulta extends javax.swing.JFrame {

	/*{
		//Set Look & Feel
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}*/

	private JPanel jpanConsulta;
	private JTable jtblConsulta;
	private JButton jbtnImagen;
	private JButton jbtnSalir;
	private JScrollPane jScrollPaneConsulta;
	private JLabel jlbltitulo;
	private JButton jbtnConsultar;
	

	
	

	/**
	* Auto-generated main method to display this JFrame
	*/
	/*public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VentanaConsulta inst = new VentanaConsulta();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}*/
	
	public VentanaConsulta() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			getContentPane().setLayout(null);
			getContentPane().setBackground(new java.awt.Color(82,209,232));
			{
				jpanConsulta = new JPanel();
				getContentPane().add(jpanConsulta, "Center");
				jpanConsulta.setLayout(null);
				jpanConsulta.setBounds(24, 12, 626, 285);
				jpanConsulta.setBackground(new java.awt.Color(255,255,255));
				{
					jbtnConsultar = new JButton();
					jpanConsulta.add(jbtnConsultar);
					jbtnConsultar.setText("Consultar");
					jbtnConsultar.setBounds(511, 193, 103, 25);
					jbtnConsultar.setBackground(new java.awt.Color(82,209,232));
					jbtnConsultar.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
				}
				{
					jlbltitulo = new JLabel();
					jpanConsulta.add(jlbltitulo);
					jlbltitulo.setText("Cantidad Disponible de Cada Ingrediente");
					jlbltitulo.setBounds(18, 40, 584, 28);
					jlbltitulo.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
					jlbltitulo.setBackground(new java.awt.Color(82,209,232));
				}
				{
					jScrollPaneConsulta = new JScrollPane();
					jpanConsulta.add(jScrollPaneConsulta);
					jScrollPaneConsulta.setBounds(204, 85, 301, 170);
					{
						
						jtblConsulta = new JTable();
						jScrollPaneConsulta.setViewportView(jtblConsulta);
						jtblConsulta.setPreferredSize(new java.awt.Dimension(276, 168));
						/*GroupLayout jTable1Layout = new GroupLayout((JComponent)jtblConsulta);
						jtblConsulta.setLayout(null);
						//jtblConsulta.setModel(jTable1Model);
						jtblConsulta.setBounds(18, 146, 159, 91);
						jtblConsulta.setPreferredSize(new java.awt.Dimension(215, 156));
						jTable1Layout.setVerticalGroup(jTable1Layout.createSequentialGroup());
						jTable1Layout.setHorizontalGroup(jTable1Layout.createSequentialGroup());*/
					}
				}
				{
					jbtnSalir = new JButton();
					jpanConsulta.add(jbtnSalir);
					jbtnSalir.setText("Salir");
					jbtnSalir.setBounds(511, 230, 103, 25);
					jbtnSalir.setBackground(new java.awt.Color(82,209,232));
					jbtnSalir.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
				}
				{
					jbtnImagen = new JButton();
					jbtnImagen.setIcon(new ImageIcon(getClass().getClassLoader().getResource("imagen.jpg")));
					jpanConsulta.add(jbtnImagen);
					jbtnImagen.setBounds(18, 97, 180, 152);
					jbtnImagen.setBackground(new java.awt.Color(82,209,232));
					jbtnImagen.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
				}
			}
			pack();
			this.setSize(670, 339);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void addListener(ActionListener actionListener) {
		this.jbtnConsultar.addActionListener(actionListener);
		this.jbtnSalir.addActionListener(actionListener);
	}
	
	public void setResultados(AbstractTableModel abstractTableModel) {
		jtblConsulta.setModel(abstractTableModel);
	}

}
